package com.example.auth.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.auth.constant.DataSourceKey;
import com.example.auth.model.domain.SysMenu;

import java.util.List;

/**
 * <p>
 * 系统菜单/权限表 Mapper 接口
 * </p>
 *
 * @author xijie.wang
 * @since 2022-04-11
 */
public interface SysMenuMapper extends BaseMapper<SysMenu> {

	/**
	 * 查询 菜单 权限列表
	 * @param userId
	 * @param type
	 * @return
	 */
	@DS(DataSourceKey.SLAVE)
	List<SysMenu> getMenuOrPermissionList(Integer userId, Integer type);

	@DS(DataSourceKey.SLAVE)
	List<SysMenu> getMenuListByRoleId(int roleId);

	@DS(DataSourceKey.SLAVE)
	List<SysMenu> getPermissionCodeByRoleId(int roleId);
}
